package de.koller.kelvin.engine.landscape;

import de.koller.aframe.plain.Sprite;
import de.koller.kelvin.engine.TileMap;
import java.awt.Graphics2D;

public class LandscapeTile {

	public final int tx, ty;
	private final LandscapeGenerator generator;
	public Sprite surfaceView = null;
	
	public LandscapeTile( LandscapeGenerator generator, int tx, int ty ) {
		this.generator = generator;
		this.tx = tx;
		this.ty = ty;
	}
	
	public void render( Graphics2D g, float x, float y, LandscapeDisplay d ) {
		switch( d ) {
			case Surface:
				if( surfaceView == null )
					generator.generate( this, d );
				else
					surfaceView.render( g, x, y, TileMap.TILE_SIZE, TileMap.TILE_SIZE, 0 );
				break;
		}
	}
	
}
